function [Ytest,accuracy]=DTclassify(Xtrain, Ytrain, Xtest, Ytesttrue)


t = classregtree (Xtrain, Ytrain, 'method', 'classification');
%view(t);
Ytest = str2num(char(eval(t,Xtest)));
ind=find(Ytest==Ytesttrue);
accuracy = 100*size(ind,1)/size(Ytesttrue,1)

Ntest=size(Xtest,1);
Clsno=size(unique(Ytrain),1);
temp=zeros(Ntest,Clsno);
temp  = temp';
temp2 = Ytest+Clsno*[0:Ntest-1]';
temp(temp2)=1;
Ytest = temp';


end
